﻿using System;
using System.Collections.Generic;
using FastColoredTextBoxNS;
using System.Text.RegularExpressions;

 /// <summary>
/// This item appears when any part of snippet text is typed
/// </summary>
class DeclarationSnippet : SnippetAutocompleteItem
{
    public DeclarationSnippet(string snippet)
        : base(snippet)
    {
    }

    public override CompareResult Compare(string fragmentText)
    {
        var pattern = Regex.Escape(fragmentText);
        if (Regex.IsMatch(Text, "\\b" + pattern, RegexOptions.IgnoreCase))
            return CompareResult.Visible;
        return CompareResult.Hidden;
    }
}
        